Some fixes from the platform
Added ability to add sprintf variables to JText string

[writing it up now...]
Merge remote-tracking branch 'remotes/upstream/master' into patch-9
Merge remote-tracking branch 'remotes/upstream/master' into patch-9
Merge remote-tracking branch 'remotes/upstream/master' into patch-9
Added ability to use custom non-language string as first part (can be used for concatenating other strings)
Merge remote-tracking branch 'remotes/upstream/master' into patch-9
Use JDatabase instead of MySQL queries
Merge remote-tracking branch 'remotes/upstream/master' into patch-9
Merge remote-tracking branch 'remotes/upstream/master' into patch-9
Merge remote-tracking branch 'remotes/upstream/master' into patch-9
Correct query format
Correct query format
Merge remote-tracking branch 'remotes/upstream/master' into patch-9
Remove unnecessary empty()
Merge remote-tracking branch 'remotes/upstream/master' into patch-9
Fix getTemplate() issue which caused an undefined variable to be called.
Fixes notice in createTagsFromMetadata().
Add support for singular folder names to legacy mvc classes.
Fix typos.