Refactored command init
Added debug printout
Extracted more ruby tasks
Added memrss function