improved error handling in study manager, move common code to core
move common code to other modules
Merge pull request #792 from dennishendriksen/master

Improved study manager error handling + moved common populator/security classes to core/security