Tweak to improve printing performance.

Most of the performance bump in this was due to the custom memoisation and changing some defs to vals, so now we shouldn't be spawning PrettyParams instances constantly for the 80% case of just using nospaces.

Also fixed a bug with the pretty printing of numbers and added tests to cover that and how nospaces/spaces2/spaces4 look.