Overhaul to current file structure

Split code into appropriate header/source files, created test header,
started embedding Doxygen tags.