Cleaned up and added documentation for everything.