Implement a new strategy for avoiding event queue mutation

The event callback queue can mutate in ways that mess up the iteration.  There are two cases we need to handle:
- While iterating through an event's callbacks, a new one is added.  This should not be triggered.
- When a callback is removed, we shouldn't actually mutate the callbacks array if this iteration was triggered in the middle of an iteration over the same array.

The first is solved by registering the callback array's length at the time iteration starts.  The second is solved by adding a depth counter to each callback array.  It's iterated at the beginning of iteration, and decremented at the end.  Items are removed from the callbacks array only when the counter indicates a depth of 1.

This patch adds a test for the addition of a callback mid-event.  It also adds one for binding/triggering groups of entities at once, since I noticed a typo I introduced while modifying the code wasn't being caught by the existing tests.
Merge pull request #832 from craftyjs/event-loop-fix

Implement a new strategy for avoiding event queue mutation
Release 0.6.3 of Crafty

Change name to craftyjs because crafty is already taken on NPM
If window is not defined
Add/remove Sprite components sometimes fails to change background-image

When switching between two Sprite components that use different background
images, the second background-image fails to get set properly.
Fix a bug in canvas entity implementation when flipped and rotated

Currently, the canvas context was saved separately for flipped and rotated entities, but restored only once.  This totally messes with canvas rendering!

This patch fixes this by only saving the context once if called for.  (I also added a couple of comments to the code.)

Unfortunately, we can't have canvas-specific tests in our test suite as currently implemented.
pos modifided for including object as well as tests written and documentation changed
Refactor mbr/pos, add tests to modules

- Simplify the logic for mbr() and pos() reusing objects.
- Add module declarations for the mbr/pos tests
Merge branch 'addisonbgross-abg' into develop
Merge pull request #839 from starwed/context-fix

Fix a bug in canvas entity implementation when flipped and rotated
Merge pull request #838 from FallSe7en/develop

Add/remove Sprite components sometimes fails to change background-image
Fix _SAT algorithm, optimize Crafty.polygon

Our current implementation of the SAT (Separating Axis Theorem) algorithm is both a bit slow and somewhat incorrect.

To improve the speed, this patch changes the behavior of Crafty.polygon to store points as a single flat array, rather than an array of smaller arrays.  This is a breaking change -- code that interacts with this (e.g. by creating collision regions) will have to be modified.  I'm pretty sure it's worth it, though.  Doing some jsperf tests indicates that dealing with a single array is much faster.

This patch also prevents the creation of temporary objects within each step of the SAT algorithm, which also increases the speed a bit.

The algorithm also seemed somewhat incorrect; it calculated the minimal overlap for each edge of each polygon, but never actually did anything with the first result.  This doesn't matter when dealing with simple rectangles, which is probably why this went unnoticed til now.

I added some tests to make sure our _SAT behavior isn't broken in the future.