Move def/shared.js back into lib/.
Implement isPrimitive as a convenience.