generators::legacy0 refactoring.

New class: db_connection.
db_connection cache implementation.