Refactoring and new modules

closes #72, closes #50, closes #74