How to avoid clearing of the form state?
This:

function module_form($form_state) {


needs to be changed to this:

function module_form($form, &amp;$form_state) {


The function sig for forms changed in Drupal 7 to the second example above.