Re-formatted code, stopped direct script access, updated PhpDoc blocks