Don't try to push notifications unless socket is defined

* this is to support custom API methods that may not have a WebSocket connection
Use method User ID paramter instead of object variable for adding Notifications
Some cleanup of the search code; added clearObjectIds() method