Move lib.php one level up to app/

Fixes #1527