From http://code.activestate.com/recipes/496784-split-string-into-n-size-pieces/