Core: safer/non-broken unsafePerformIO usage

still pretty sketchy though
add something to Test
compileNode: optimize common case of 1 child
update comments in Test