Merge pull request #91 from Turbo87/units

Units testing and simplification
templates: Append SQL query information in debug mode