Factor out the rules for merging tiles.

The old code hard-coded the rule "a.value === b.value" in two places,
and also hard-coded the merged tile's value as "a.value * 2".  To make
it easier to hack together variant versions, I've factored this logic
out into a single function GameManager.resultOfMerging(from, to).
If the tiles can't be merged, the function returns null.
If they can, the function returns an appropriately initialized new Tile
(except that the position may safely be left as "null").

No intended functional change.
Would it be possible to clean up this logic a bit, e.g.:

```
var merged = next && !next.mergedFrom ? self.resultOfMerging(tile, next) : null;
```