finish basic implementation of tags, misc cleanups