factory for building JavaScript objects, mostly useful for setting up test data. Inspired by factory_girl