Pervasive renames to internals.

The goals here are to:
 1. Move away from the temporary Pirate* prefixed names.
 2. Make thinks consistent throughout.
 3. Make things read ok.
 4. Avoid name clashes with standard library.

Have generally erred on the conservative side to avoid clashes for now, can do another sweep later on, to give things nicer, shorter names if possible at a later stage.