Refactor tests to clearly distinguish between unit and integration.

New unit tests are required to get full coverage.
The tutorial should also be updated.