Initial edit.  Not a whole lot of testing since I pulled it out of the primary project and dumped it into GitHub.