Implemented word_wrap

Do let me know if there's a more idiomatic way to do this.