Move calculation of square joins and caps to static methods.

These will be of use when correctly implementing hit-testing of strokes.