Implement a stub buffer module with a few unit

tests written with the help of LuaJIT's ffi library