Issue #492720 by pivica, seutje, nod_, JamesAn, sun: Refactor system.js file and use Drupal form states and form ajax.