Add logging for almost all exceptions caught in views

This relates to https://github.com/jfinkels/flask-restless/issues/152

Also, disable logging for tests.