Moved main function into its own file.