smalloc: change namespace, add params checks

The namespace made more sense to be Smalloc, even though it isn't a
class. Also added a few checks to make sure inputs are safe.