Eliminating contextmanager based transaction-handling

Rewriting as contextmanager

Code review fixes