A bit of tidy up and comments added
Completely rewritten and organised into a library structure
Added a note about library dependencies