[refactoring] Error handling and memory improvements

 - Extracts the work with shared memory
 - Removes the dependency on UniversalErrorCatcher, adds own dummy catcher to handle the fatal errors