Move advanced / twrp code to separate include.c for easier maintenance