Removed main() function.
Reorganizing, renaming.
More reorganizing.