Use npm version of mocha and chai.
Tests are now faster and more reliable.
Clean up dialog creation logic a little.
Merge pull request #41 from MessiJS/increase-test-coverage

Tests are now faster and more reliable.