Move tap functions out of dl function scope.
Refactor tap tests into a light helper object, only output tests in test mode.