Extend the logic for safe function calls a bit

E.g. "getEventListeners(window)." should auto-complete.
Issue 6522: Implement the getEventListeners command line API

http://code.google.com/p/fbug/issues/detail?id=6522
FBTest for issue 6522 (Implement the getEventListeners command line API)