restructured parsing to catch invalid attribute names

builds on top of https://github.com/mozilla/thimble.webmaker.org/pull/318, so cannot be landed until https://bugzilla.mozilla.org/show_bug.cgi?id=939133 is cleared. When that happens, this patch will be rebased.