writefields method taken from remoteTK, as private method shared by create and update

Update was having issues with certain types of data (dates especially) on the apex side.  The code used on create was working fine, but update didn't have the advanced casting.

This also fulfills the mission of being closer inline with remoteTK, where create and update are sharing the casting and field error handling code
Update ngForceController.cls
Merge pull request #5 from mshanemc/master

writeFields method to be shared between create, update