refactored fromWhere method: moved out some code into other methods.
Bind::prepare argument was wrong! fixed the test cases.
refactor to clarify the code.