Rewrite parser from evil <php> to JSON powered <function>