Counting unique unwrangled tag uses

There are a lot of whitespace changes too, because I'm a bit compulsive about spacing standards, but the main actual change is a bunch of .uniq for the unwrangled by_type counts.

http://code.google.com/p/otwarchive/issues/detail?id=2272

(I know, a pull request, oh the irony! In my defence, this was old code, sitting unpushed, that I only had to refresh to the latest master.)