require js copied from john papa git