Refactor functional tests.
Add scanner.