Introduce Debug mode

- Introduce debug mode
- get rid of ?> to avoid some extra space or new line at the end of a
file (causing error when rendering image).
- SQL Query can now return more than one row.
Update revision