large rearrangement of all module, have a smart selection working, added tests on restraints and selection