Added loop function registration. Made loop function library optional, since it is already automatically taken care of by CDynamicLoading::LoadAll() in main.cpp.
Added test loop functions, modified lua test to use it.