Improved variable formatting for JS and docstrings