Add transactions for import

closes #837
- added transaction handling for import
- added transactions to model functions
- added simple tests for failing imports
Merge pull request #1415 from sebgie/import-transaction

Add transactions for import