Fairly major refactor. Just need to fix one major bug and add a license before calling it 'alpha'