Move Whoops code into its proper place and implement ajax support for json files