Refactor tag names and ref names a bit.

Please see individual commits for more information.