modified rewrite.js

use jQuery.each
Merge pull request #1 from kazuhisa/master

use jQuery each