Implement a new tag parser (and fix a load of other issues)