More endian macros
Add environment sanity tests
Fix ringbuf tests