CLIENT-255: apply several refactorings
CLIENT-255: apply several refactorings

 - Some algorithmic duplication is removed.
 - Several magic strings and numbers are put in named constants. Later we can consider moving them to separate place.

 - Console error occurring on reaching page border is fixed.

wavesplatform/WavesGUI,wavesplatform/WavesGUI,wavesplatform/WavesGUI,wavesplatform/WavesGUI