Moved load_app before its usages
Added some tests for lib