Update dependencies
Move test file
More refactor, add 'debug'
Fire 'close' event