Huge refactor of AST model

Rebased the AST model on the driver implementations from Rethink
themselves using classes. Much more flexible, and Implicit vars working
now