Better regex & version vars, more error checking

May be really inefficient. Working on FF30.