Initialize MySQL instance when needed
Summary:
$db was populated at global level.
This change introduces a singleton pattern in the sql_db class
to load it when needed.
If a container is introduced, sql_db could be a facade for the
SQL service in the container.
Ref T1294
Reviewers: dereckson
Reviewed By: dereckson
Maniphest Tasks: T1294
Differential Revision: https://devcentral.nasqueron.org/D1162