Album: Remove hardcoded table names
Move pointer types to a specific file
Use a pair of shared_ptr/weak_ptr to monitor the database connection

This will avoid random crash due to dangling pointer in case the DB was
released
Do not use an entity with invalid DB connection to fetch resources