Refactor module structure

Make everything into modules