A lot of refactoring

All test pass, but a few where disabled pending some refactoring to genetic variant.