updated to work with new jsdom and some cosmetic changes
 some maintenance