Added lots of comments to the server scripts and fixed the library.php issue.