Implemented table cache flushing.
Merged with master.