make slightly more friendly for cross compiling
clean up stack magic and other code
start adding I/O stuff