Refactor

* added scoping to DSL for more powerful options
* event definitions now include the logic in a provided block (no more data sources)
* code cleaned up substantially
* compiled event representations are hierarchically nested, cached
empty spec still needed?