Refactored single entry point.

Refactored the code to always use dialog.php as the entry point; this is a first step.

Added composer.json, in the future i'd like to load all dependencies via composer.