Split code into separate files

I've split up the code into separate classes