Add sphia_purge

Makefile adjustments are ugly.  I'd be happy to refactor if anyone has suggestions.

Added simple tests, but I'm not sure they're enough.  I'm also open to suggestions here :)