Fix for bad user queries in reports

This PR adds a "BadRequestError" exception to the reports module, and catches this exception on dispatch to return a 400 instead of 500.  I'm working on differentiating between the two in the js, but that's still to come.  If you have the occasion to need to raise an exception due to bad requests in the reports module, check it out.  Is there a site-wide version of this I should be aware of?  Should there be?

Edit: okay, now the client can distinguish between 400 and 500 errors, and I've added separate error messages for each.  Feel free to change them (or send me better text and I'll update the PR).  They are:

* 500 -> There was an error with your query, it has been logged, please try another query.
* 400 -> Your search query is invalid, please adjust the formatting and try again.