Added check for if we're running in __main__

...to make the app work in live hosting environments.