make relative pathname for require.
Fix toJSON behavior to work with node 0.11