Main, some simulation thread stuff, move non-main files to subdir