Cube extension point support

https://commitfest.postgresql.org/action/patch_view?id=1179
http://archives.postgresql.org/message-id/EF7A0879-4E83-4AAE-997D-222D6761E1C6@gmail.com