Cleaned up main.c by moving functions and structs to header file; Resolves #34; Resolves #36