javascript read functions from file