Factor out library(tap)

I've moved the TAP code to a separate pack so that it can be used in
other projects.

Closes #4