Renamed some internal types, add some more doxygen style comments.
Moved IO related code into its own header/source pair.
Moved IO related code into its own header/source pair.
Update.