Move tag subtraction into separate function.

(This *will* go in models/tags soon!)