Moved all the code into individual files.