Massaged things for Haddock and added JSON support

I'm really bad at making atomic commits. Later, later, later