Added smartWhere object, also treats where clauses as first class citizens for hasMany associations. Closes #757