added multiple 'where' key support

massive overhaul
TODO: go back and re-add the inline documentation I had to strip out.