Splits code in EmsCommon#update

Splits update method into several smaller methods according to button
used.
I think it's better to leave the full method names in the code rather then calling send on a string. The reason for this is readability and ease of search and other processing of the source code.
Also by writing the case statement the values are explicit and easy to see.

We can raise an exception in the else branch. But we don't really need. Because 1) we do not have a nice unified way of handling exceptions and generally errors in the UI (we have to fix that at some point) and 2) this code is going away when we rewrite this part to Angular.js anyway.

So just by doing as @petrblaho did I think we are OK. Better readability, smaller method at least.