Add a 'safe' build tag to use the safe versions of the internal algorithms

Makes everything overall 70% slower, but you can feel good about not
using code that uses unsafe. Also aids debugging.