Add docstrings to some functions in emperor.js