Add optional Javascript callbacks on all API endpoints

I wrote this at 3am, so it's proly butt ugly code. Some things that still need fixing:
 * Configurable in the config file
 * /endpoint?callback=example redirects to /endpoint/, dropping all get args
    IMO should have /endpoint work and be encouraged, tailing slash is silly
 * Whole thing needs to be rewritten in python