Fixes #4866: Refactoring of SmartProxy functionality into isolated modules.