Generate main "on the fly" (hide from user)

Closes #22