big refactor of defintion json, and thus the code
refactored to be stateful, and use a defn object
Merge pull request #21 from dbouwman/refactor-to-spec

Refactor