init.php: Minor refactor
lib: Add a history.php API
login.php: Use pip_history_get_referer()
lib: Add a goto.php API
session.php: Add a pip_session_unset() variable

Issue #96.
login.php: Add a php_logout() function

Issue #96.
Add a logout.php page

Issue #96.