Started working on NaN  support as per #128. Also improving typed-array alternatives for #39.

Committing so I can work on this further at home.