Refactore repository and remove static context dependency.
Add logging to database and remove .net trace config (because unusable for our case -.-)