improved library handling, refactored mosts things to libraries, removed global hooks
Merge branch 'develop'