Converts HTML form into JavaScript object