Cleanup, made some functions private, and start at documentation