[mysql] Support pooling interface and restructure a bit to be cleaner