many fixes and code rewrite
First release for Drupal 7.x under CTools API
security fix
apply security fix