Small refactor for activerecord task.

Refactor padrino project generator.

Refactor a few generators.

Remove code duplication.