More refactoring.
First pass at text wrapping. This is still not complete because I need it to break at word boundaries or be hyphenated.
Removed some TODO comments.
Added code to automatically compute length of tick labels and adjust margins accordingly.