Javadocs and general cleanup