Changed run.py to core.py because running the core will be from elsewhere e.g. web interface.