Move from objects to utility functions and share `isBlockElement`

I used [Grasp](http://graspjs.com/) to do some of this refactor, which was fun.