major code structure refactor

closes #3
2.4.0