Use AR relations to save fields/inputs and values

Instead of saving/destroying fields/inputs and values one at time
Use the Active Record relations to save these with a single save
call on the parent. This is done by adding the :autosave to the has_many
relations

It also includes the removal of to_i calls on the id fields. This will
help us when we switch to GIT and have strings as id's and the to_i
calls would fail
@Fryguy. @mkanoor : `find` is very powerfull http://apidock.com/rails/ActiveRecord/Base/find/class together with Rails Magic(tm) such as automatic XML and JSON conversions the direct passing of `params[:id]` here might have very serious consequences.
So we should stick with the axiom that user input is evil and make sure what we allow only values that we expect.

Matching input against a RE, `.to_i`, or at least a `.to_s` might help.