Added JS exceptions + fixed up floating precision mess up
Added exception checking to unit tests
Handling NaN values for floats