a much more thorough fix for 64 bit number encoding

hey guys, sorry it's taking two patches, but i did a much more thorough test of numbers and found that the previous implementation still has trouble with a certain set of numbers. anyhow, this should handle everything up to 2 ^ 53 (the effective max int in javascript)