adding newrelic hook into application

* also cleaned up some pep8/flask8 style