Minor refactoring to models and some controller actions. Added basic documentation to models.