Fixed a bug in location model in models.xml
Fixed a bug preventing JSON from being sent in POST
Added code to generate insert code for foreign key arrays