Refactored view into class.
Merge pull request #5 from rhyolight/refactor

Refactored view into class.