tpl driver added ability to use avail_arrays inside ifs and foreaches
unit tests for tpl core driver updated