Update a few memory functions to log their inputs and outputs. To avoid the use of 'goto', etc. the functions are turned into stubs, calling a separate function to do the actual operation. Add a few tests. Signed-off-by: Simon Glass <sjg@chromium.org>