More error checking in the FFI, support for typedef/more types, basic co...

More error checking in the FFI, support for typedef/more types, basic console lib etc