New SQL parser

The old SQL parser made it quite difficult to verify WHERE
expressions properly. This new one spits out useful datatypes for
matching data against the expressions, correctly handles boolean logic
(the old implementation always ANDed expressions together), and also
generates much more accurate javascript code for the Riak backend.