Started to split code into more files for easier reading and refactoring. Not curretly compiling.