[WIP] move appframefork portions into core


**DON'T MERGE**

FYI: @karlitschek @butonic @Raydiation @bartv2 @icewind1991