Move CREATE TABLE/CTAS analysis to a new method.

This includes adding a new QueryBlock that's used to store detected cache modes.

Also, renamed MemoryTableDesc to MemoryTable.