Related topics that led to this solution:
How to pass an aditional parameter to JS transform in item definition
[SOLVED] Use jsonPath in JavaScript transformation?
HTTP binding outages of 1-3 minutes - why?
Thanks @vzorglub, @lfs_alp5, @wborn for pointing me the right directions and @dim, @mhilbush, @rlkoshak for helping me with bugs/errors along that way.