Clean up JS in preparation for #156.