Clean up some code as per perl critic report
Add some tests for the appliance controller (currently not working)