Advanced expression evaluator in javascript