Progress Bar Plugin

Rewrite some code of the plugin progress bar, fix some small bug, and
make the code more human readable.