Allow main.py to be run from other python files.

Added run_main() function, which can be called by functions in the same
package to run the main file.