Refactored script so it could be imported as a module.
Changed behavior to make a new deployment dir instead of reusing an old one.
Added samples.