Numerical renormalization group for bosonic systems and application to the sub-ohmic spin-boson model.