core: Add context switching for ARM and MIPS

ARM definitely compiles
auto merge of #5333 : brson/rust/context, r=brson

ARM definitely compiles