Added Field and Function listeners to build symbol tree. Some minor refactorings. #1