Basic clean-up done. Files need comments and a few tweaks.