Moved core JSON parsing code to portable library