Brought in slighlty improved main file versions
Finished immigrating new code, renamed files