Added unflattenObject function and fixed refreshItem method. Fixed #16