added tests, restructured ast walker