http://codereview.appspot.com/74074
Completely re-factored and separated out expression parsing - this should make it a lot faster and less buggy for complex expressions. Paves the way for more robust expression rewriting to make all implementations consistent.