Move terms and tags code to a new tags.cc file.