implement memory_buffer.commit
get rid of a friend in memory_set
split implementation of buffer commitment up