More javadoc comments. Did my best to document the functions in the UI I hadn't written.