Code improvements

Based on #32 

Solves:

* HTML5 mode (non-hash URLs)
* directive element restrictions