cleaning up NPE in the realm manager, and adding clear() method calls to the embedder to cleanup the realm manager after it's used, to try to keep the number of open realms to a minimum...