Added load and run method, fixed loading bugs

Fixed a bug that would cause a mix of async loading and synchronous
loading to fail.