fix bugs, get tests working, add resolve method.
bring back old compiler method and make tests pass