Removed unnecessary template specializations, removed workaround for compilers not supporting partial template specializations. Use unsigned integers for bit counting, which allows to replace the division with a shift.