Added check for if we're running in __main__

...to make the app work in live hosting environments, eg. PythonAnywhere or Heroku.