[1537] Added tests to new functions.
Corrected imports and js - used $.each() function.
Added test to new function. Results in gist:
https://gist.github.com/Exorades/0b3d20fdeba2c6ad60ca