Make specialization of SQLAlchemy caching easier

Make using caching with SQLAlchemy a bit easier by separating most concepts in their own classes ans methods. For example, an application that would be using a different base ORM class would only need to make it's own class based on DefaultIdentityInspector and override only the meaningful parts. Also, it should make testing easier in the future.