Add general calc_BB functions and add dynamical expansion to uniform_multi.
Use general calc_BB functions in tdvp_gen.