3.x: rules and drush

Hi, backported Rules and Drush integration for the 3.x branch.