Fixed serializing/deserializing of closures

1. The upvalue detection could get caught in an infinite
loop in cases when the upvalue was nil.
2. Closures that contained themselves as upvalues caused
another infinite loop that would end in stack overflow.
Such closures are common, as that is how lua implements
recursive local functions.
backward compatible function loading
Merge pull request #55 from jameskirkpatrick/master

Fixed serializing/deserializing of closures
Update maths.md

Typos everywhere! Aaaaah!
Merge pull request #56 from Atcold/patch-1

Update maths.md
adding torch.isSameSizeAs
Merge pull request #57 from torch/isSameSizeAs

adding torch.isSameSizeAs