Rules refactoring phase I.

- Move rule related popups out of {{if hasMonitoring}} to get rid of
  re-rendering code
- Remove unnecessary rendering code. Also insert some missing ';'
- Fix rule slider rendering
- Clean up rules controller
- Show rule spinner using handlebars
- code cleanup
- Unify rule's updates
- Shorten saveCommand function
- Simplify rule creation and empty machine_id, backend_id field from rule only
  when machine is found