Lots more work towards callbacks.
Try to fix stdint macros again
Fix include/define order.