Use scan to return all matches.

Uses scan to return all matches instead of match. 
Modified the javascript to accept scan results instead of match results.

This way, the functionality is closer to Rubular.