secrets.php to remain secret.
Updated comments.
Better comments, better empty attribute values.
Untangled constants and secrets.
Added a few comments.
Now context is chosen based on a specified request type.
Removed constant definitions.
Added comments.
Split a monster function into smaller pieces.
Cleaned up a little (comments, includes).