restructure init.php and lib/function.php, init will hold most variables and none in lib/function