Added form class FormalityForm and related helpers.

NewForms now has a form function that can be used to kick off the form
construction process. This now works:

  case class User(name: String, password: String, age: Int)

  def fieldChanged(newValue: String) = {
    Run("console.log('Saw value ' + newValue + ' on the server.')")
  }

  val nameField =
    field[String](".name") ? notEmpty -> on("change", fieldChanged _)
  val passwordField =
    field[String]("type=password") ? notEmpty -> on("change", fieldChanged _)
  val age =
    field[Int](".age") ? inRange(0, 130)

  val userForm =
    form withField nameField withField passwordField withField age formalize().
      onSuccess {
        case name :: password :: age :: HNil =>
          val person = User(name, password, age)
      } onFailure {
        case Full(name) :: _ :: _ :: HNil =>
          println("At least the name was present!")
        case _ =>
          println("Can't get anything right...")
      }

  "form" #> userForm.binder()
Added FormUnapplier helper for case class extraction in forms.

This now works:

  case class User(name: String, password: String, age: Int)
  object FormUser extends FormUnapplier(User.apply _, User.unapply _)

  def fieldChanged(newValue: String) = {
    Run("console.log('Saw value ' + newValue + ' on the server.')")
  }

  val nameField =
    field[String](".name") ? notEmpty -> on("change", fieldChanged _)
  val passwordField =
    field[String]("type=password") ? notEmpty -> on("change",
  fieldChanged _)
  val age =
    field[Int](".age") ? inRange(0, 130)

  val userForm =
    form withField nameField withField passwordField withField age
  formalize().
      onSuccess {
        case FormUser(person) =>
          // do stuff with person
      } onFailure {
        case Full(name) :: _ :: _ :: HNil =>
          println("At least the name was present!")
        case _ =>
          println("Can't get anything right...")
      }

  "form" #> userForm.binder()