Moves the view code into a new module

Moved the view helper code into a new module under quark, and cleans up
a few other bits of the code as well.