implement views

along the way, refactor a large portion of the code to use
prototypes. This way, it's easier to reuse methods between
the view and "normal" classes.