Extend media and user database

- Decouple database and xmlloader