Refine the replace regexp rule to make it more readable

/[^\s]+/g equals to /\S+/g, but the former is hard to understand. Just like #122, but also changed the lib/observable.js. The riot.js is produced by make riot.