gras: move sbuffer inlines into lib

This avoids inline ASM to be LLVM JIT friendly.
This commit includes a unit test for jit factory + sbuffer.