Refactor commands, and allow -p option to bundle