Fix finding identifiers, add more scanner tests, and fix import