Refactor handling of ensure and version options

This also fixes a bug when 'present' was handled as a gem version.
Merge pull request #1 from RexOps/0.46

Refactor handling of ensure and version options