Add a schema generation number to avoid using stale table structures.

This is a stop-gap at best, until tables use the same caching and locking as btree handles.
typo
Add new exported symbols
Style cleanups: long lines, new spelling.