Add a check for empty files in XMLParser

A non-useful parser exception used to be displayed. Now explicitly
complain about empty files, to better diagnose issues.
Fix PSR-2 in addonXMLParser

Fix some formatting issues in addonXMLParser class.
Allow specifying a smarty template cache explicitly
Extract uploaded archives directly from upload tmp

Also made the upload scratch dir customizable.