Require category in document blocks

Categories are needed because otherwise we don't know what file to write to. This fixes #82

@jho406, this touches some of the recently refactored code, mind giving it a once over?

cc @aflanagan @VinSpee