Fixed structure and split up some files into both .h and .cpp files.