Example module for Drupal 7 about creating an entity in the system