implementation of openchangedb_table functions

This need A LOT more unit test, I'm sure there are more bugs than lines of code here