Some style and error handing improvements.
Also adds a first attempt to do proper stack rooting in the function EnumeratePropertyNamesWithPrefix.