Move last non-view function to lwp/utils.py

The next thing is to move all views out of bin/lwp in a separate file like lwp/views.py

As per these guidelines: http://stackoverflow.com/questions/9620575/in-flask-why-are-all-the-views-shown-in-a-single-file