ViewSets implemented (fixes #1). Refactored some inner methods.