Moved code dependent on IQueryable to a seperate implementation.

This makes it less of a pain to implement custom data providers.
As it is very hard to implement IQueryable completly it is better to isolate the code using it.