Fixed methods visibility and incorrect method & variables access

Fixed a host of small things, such as bad private method calls, bad
option variables references. Added Sitemap human readability with
newline chars. Made all inclusion requirements at the top of the file.
Declared explicit variable & method visibility for php 5+.