Fixing Tag.byresource

unit tests found a few bugs... fixey fixey.  Closes #86