Reverting spaces to tabs. Removed unused function.

Reverted spaces to tabs so the diff between the upstream project and
ours is more aligned.

Also removed an unused castJsonToClass method.