Fixes for Hash.flatten, Hash.merge,

Finally solved recursion limit on flatten issues, repaired merge and
expand to behave strictly involving array keys.