Clean up unneeded template instantiation and move internal n_bits function declaration out of data declarations