Nilpotent groups and compact 3-manifolds