Moving to tokenize

Tests pass.  Some of the stuff I changed might need refactoring.
Sounds good.  The function is probably pretty limited outside of spun.  Would you prefer it go in 'helpers.js'?