Added README and changed script so only when() is exposed globally