added dateformat as a meteor package
fixed issue #8, added ownsDocument into permissions, refactored code