Cache: Improve data representation for dependencies

By storing the dependencies in a format where all units that
depend on a specific unit can be looked up easily, we can improve
performance in the `invalidate` method, since we no longer have to
loop through all dependencies.
utils/matrix: Add a fast clone method to copy matrix data
Camera: Use the new clone method from the matrix utils
utils/isInstanceOf: Slightly improve performance

Array.prototype.slice will create a new array object, which is not
needed when we can check with only strings. By using slice we are
also leaking the arguments object, which is not recommended:
https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#3-managing-arguments
Normally, this would not be a problem, but as this is a function
that is called a ton of times each frame, it needs to be optimized
as much as possible.
Optimize calls to calculateOrigin by allowing specific axis

By passing a specific axis to calculateOrigin, we can get the
numbers without creating a new object that hosts the x and y
properties.
Canvas: Cache and reuse the return object of getViewModeValues
CanvasObject: Use a for loop to save function objects

This will be called many times during a single frame, so it should
be optimized to not allocate too much memory.
CanvasObject: Return the cached matrix if the reference is same
CanvasObject: Only update the transformations matrix when needed
CanvasObject: Reuse temp array to not cause new allocations
Camera: Don't set the new reference if it's still valid
CanvasObject: Don't cache anything in getPointIn
Update to matrixmath 2.2.0 for better performance
CanvasObject: Don't use arrays of matrices when multiplying

Using arrays will either create lots of new objects we don't need,
or we use a cache like we used to do here, but then you keep
changing the length of the array. The content of the array is not
really that dynamic, so we can just pass the matrices directly to
the multiply method instead of passing an array of matrices.
CanvasObject: Decrease multiplications needed in getPointIn

The desired outcome here is to get a matrix representing the
product of the transformation matrix and the input point matrix.
To do this, we had to create an identity matrix to start with
something that won't affect the outcome. However, with the new
version of the matrixmath package, we can just copy the data from
the transformation matrix into the output matrix, and then do a
single multiplication by the input point.
utils/isInstanceOf: Allow the function to be optimized

Reassigning parameters while also mentioning `arguments` in the
function body might make JS engines go into an unoptimized mode.

https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#3-managing-arguments
Camera: Invalidate obj cache when vertices reference matches

In some cases (when triggered from CanvasObject#getPointIn) the
reference passed to CanvasObject#getTransformationMatrix is not
the original reference object, but an object one step in (for
example, if the reference passed to getPointIn is a canvas, the
reference it will then pass to getTransformationMatrix is the
scene).

For this reason, we can't always check against that reference when
invalidating the camera cache. We must also look at a cache for
the original reference. The one that calls getPointIn is
getVertices, so we can use the cache unit vertices-reference.
Add .jshintrc to lint nicer with node modules