Updated xpvm's malloc to be in line with new documentation and some general code cleanup.