refactor run command js
[WIP] support for adding scheduled commands (one time or cron)