DO NOT MERGE. Refactoring of SmartProxy functionality into isolated modules.