Moved format variables into $self

Pass $self to all hooks

Removed %imports, one of the grosser aspects of the code