Clean up JS prototype exercise and add testing code.