make tag parser something more like a parser; tolerate spaces in tags

need to return errors on invalid & more tests