cpp implementaion of Text Justification

Many pitfalls of the corner cases and programming details.