Clean up event attach code
Significant refactoring

Rearranged the order of attaching events.
Refactored addEntity/Entities code.
Added entityValue function to allow configuration of how an entity
picker input value is set / calculated.
Fix resolution of 'this' within $.each
Further typo fixing
More silly typos
Fix .call vs .apply
fix call to entityValue
More call vs apply mistakes
Fix addEntity
Typo in addEntity
Still fixing addEntity

Maybe I shouldn't be doing this while tired.
Changed html to demo new entityValue config option
Added comment about entityValue
Fixing layout of example
fix example position
irksome pre
Replace pre with div
More code formatting