Cleanup and changing to using HEAPU8