Refactor pushd.coffee, otherwise it is slowly becoming unreadable.