Improve docstrings and move global variable definitions out of __main__().
Fix Procfile