Add shorten function in Utils
Add shortenTest
Merge pull request #22 from mymargaret/master

Add shorten function and tests.