WIP on rails/arel#118

As Work In Progress promises, there is no guarantees on its working
status and minimality.

I actually worked on this quite a few month ago.
I did not publish it as I stumbled upon the already filed issue.