Add format

Hey, 

This PR fixes the rewrite test which was failing, and also exposes `jsfmt.format()`. Let me know if it's ok or needs work!