Merge where command

Implemented the where command and fixed some precedence bugs in the process.