Adjusted FromJSON for Reference so it's more forgiving.

In particular, suitable strings are coerced to integer values
as needed. Closes #1094.