added a test to make sure the davejs module has getName() before saving
wrapped all davejs modules in a closure and added a define function