Changed to allow for submits via pressing enter in Safari, and restructured to follow Drupal conventions.