Add PDF Normalization

#566. Still need to fix some coffeescript syntax, use random.Id, add a database migration, change `files` to `cached`, and update comments.
No. Probably a consequence of copy-pasting. It is anyway top-level scope (`unless` does not create a new scope, so this is top-level scope, just not imported at the top, which decreases readability of the code and should be fixed, not duplicated).