Add basic checks for machines controller
Replace duplicate code setting name with a before_filter
Load machine in a before filter in MachinesController
Dont duplicate rendering code in every action
Render 404 in a before filter, removing the need for if nil? checks
Make sure the cloud domain is set before each action call
Fix spec - use post to call actions in MachineController
Add check that no op is called when node not found
Rename render_machine to render_empty_json, use explicit render in show
Use flash[:alert] instead of flash[:notice]
Use JSON response for 404

Update tests to reflect this.
Merge pull request #840 from bkutil/refactor_machine_controller

Refactor machine controller