Adding the collection names support to DB

I hope this is now ok. Also added simple spec to verify it works :-)