separated core SQL related functions (inloop, tblretrieve, pvtconstruct) into a separate r script as a proof of concept of partitioning the code between multiple scripts and users