Refactoring for a summer

This is what we were able to refactor in one summer.
Hope everything is fine and dandy.
If problems or questions arise feel free to shoot a message through github.