Fix tags as much as possible

Need tag search to be implemented before tags can be completed.

* Sorry for the noisy diff - I have made my editor whitespace tolerant to make future diffs better