Validates a subset of Javascript in Javascript