Move most of the main program to newfol.main.

There are a few peculiarities of the main program that need to stay in the
newfol script.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>