Add transactions for import

closes #837
- added transaction handling for import
- added transactions to model functions

Special thanks to @tgriesser for awesome debugging!