Structure of nilpotent Lie algebras and Lie groups