index.php: Changed interface for practical useage.

lib.php: Appropriate code was moved here

view.php: To showcase how to pull files from external pages