Cleaned up some of the code and improved robustness (a bit).  Also, added keeping track of modified/created time.