Added additional error checking, feature to clean the working git
directory, and other cleanup.