Tweaking and some additions

Added TPAAlign, TPABoundingRect and TPALongestVector by slacky! With
small modifications, though.

Tweaked TPARotate and StrReplace.