Refactor text wrapping into its own file
also fix a very nasty bug with colorcodes (a signed vs. unsigned problem)