Massive code reorganization update

Common functions are now contained in a separate file, lib-lyger.lua.
Scripts that require these functions will load this library instead. If
any functions in the library need updating, you'll only need to download
one file and all the scripts that use it will start to work better.