Inner namespace removal step 1: Core, also fixed unrelated iOS compile errors