rejig things a little to use meteor template events and move view code out of lib