apply BSON encoding hooks to query objects and replace arrays with BasicDBList

Some comments:

1. We using fongo from Scala via Casbah and it uses encoding hooks to transform scala collections to java. I'm not sure that filterLists is a good place to do it, but it seems to be most simple way.

2. Once filterLists converts lists and maps to db objects, I think it will be good to convert arrays too. And it makes special array processing (like was in idsIn) unnecessary.