Restructed a ton of files

Moved all implementation details into separate .cpp and .hpp files