Put all javascript in the module files. Custom calc for the mcp3008.