Make better use of parser gem's classes.
Make sure we bomb out when the resulting code doesn't have a valid AST.