Move top-scope code into main() function

So that I can use simple_functions from another module via `import`
without the top-scope code being run.