External provider fixes and optimizations: BACKLOG-3653 , BACKLOG-3734 , BACKLOG-3738 , BACKLOG-3739

Reorganized code and moved backend code (Hibernate stuff for ID mappings) into a separate class.
Optimized Hibernate queries.
Introduced cache for the mapping from external ID to internal UUID for external content objects.
Fixed ID mapping update when moving a node (also consider child nodes).
Fixed deletion of mapping in case an external node is deleted (also consider child nodes).
Lazy load binary data so that we do not need to read all the files when listing nodes.
Optimized and corrected node type detection for module content.