more js functions to awk parsing conversions
move code around
awk-way input cleanup
declare global variables in BEGIN block, add also END block
main loop conversion
no exec() in awk
use proper awk syntax in functions