improve store/retrieve built-in command

store to internalStore when no explicit storage specified
check that the target store (or internal store) is valid for
store/retrieve
add tests for store/retrieve
change parameter order to be key name first