added relay support to the mcp3008.rb script
refactored lightswitch code