Module refactoring and first tests

I've decided to refactor the module because doing something like this:

```
// pseudo-code
var ewmh = new EWMH(X, root);
ewmh.on('some_atom_event', ...);
X.SendEvent() // to request change some_atom
```
could lead to losing the event in the case the SendEvent was sent before the ChangeWindowAttributes on root