Did some internal refactorings and improved YARD documentation.