Big refactor #1

Start moving non-view functions to from bin/lwp another file (for now just lwp/utils.py), except API stuff.

The idea is that after this, bin/lwp should only contain views.

I had to move where the conf file gets loaded too because one of the functions used it, but this will get cleaned up when I moved to pyramid anyway.