Refactoring

Turning everything into proper packages