Using sqlalchemy events instead of legacy extensions.

Removed legacy mapper and session extensions.

Updated mapper and session to use sqlalchemy events.