LPS-32637

Hey Sampsa,

I did some source formatting. Take a look at the code, and if it looks good to you, please send it to @ipeychev for the javascript final review.

Thanks!