title: Convert an HTML form field to a JSON object with inner objects
body: <p>Given the following HTML form:</p>
  
  <pre><code>&lt;form id="myform"&gt;
    Company: &lt;input type="text" name="Company" value="ACME, INC."/&gt;
    First Name: &lt;input type="text" name="Contact.FirstName" value="Daffy"/&gt;
    Last Name: &lt;input type="text" name="Contact.LastName" value="Duck"/&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>What is the best way serialize this form in javascript to a JSON object in the format:</p>
  
  <pre><code>{
    Company:"ACME, INC.",
    Contact:{FirstName:"Daffy", LastName:"Duck"}
  }
  </code></pre>
  
  <p>Also note that there might be more than 1 "." sign in the field name.</p>