Save memory by only defining these methods once
Merge pull request #286 from candy-chat/feature/save_memory

Save memory by only defining these methods once
Revert escaping change which broke a bunch of stuff

Revisit this as Strophe change
Track main roster

* Request our roster when we connect, before sending initial presence, according to http://xmpp.org/rfcs/rfc6121.html#roster-login.
* Emit events when the roster is fetched/updated
* Aggregate status for multiple resources
* Permit bootstrapping roster from cache (roster versioning) via options to Candy init
* Associate a MUC ChatUser with its Contact from the main roster if they are not anonymous and are present in our roster
* Add basic tests for processing room presence

Closes #287
One on one messages should be opened in a single tab regardless of the resource they came from
Messages to an individual contact should be directed to the full JID he last used to send me a message

In case I haven't yet received a message from him, I will send to his bare JID
Reset 1-on-1 target JIDs on presence
Release resource lock when receiving a message from an alternative JID
Direct one-on-one chats opened from a MUC to a user's real JID if we know it
Detect messages from room JIDs properly
Fix excludeInstrumentation regex to not include libs.bundle.js
Merge pull request #288 from candy-chat/feature/one-on-one-chat

One-on-one chat fixes
Fix package.json deps specs
Test coverage of presence handling
Reduce repetition in handling of our own room leave presence
Merge pull request #290 from candy-chat/feature/event_test_coverage

Full test coverage of presence event handling
Whitespace fixes
List in tests the things that still need testing
Test coverage of message event production
Tests for and fix chat state notifications

* Notifications can come in a message that has a body or other elements
* The existing namespace was catching candy:core.message events in handlers which are expecting simply chat notifications
* Chat state notifications also work in MUCs
* Should handle active and gone states
* Refactored for simplicity

//cc @melissanoelle