Move template selection in class, add tests

* Moved template selection logic in Project::selectView, added tests.
* To get global status for a file is not necessary to provide a locale code anymore. If locale code and json are set, returned JSON record include only the requested locale (issue #141).
* Cleaned up $_GET variable, when they're available from inc/init.php ($json, $filename, $website).
* Global status: print an error (and return 400 in JSON mode) if website+file is not supported, avoid warnings for non existent website or locale.
* List locales for project: return code 400 if list of locales is empty. Don't display list of supported locales for website if the file is not valid.
* Renamed local $json variables to $json_data to avoid conflicts with global var $json.
I don't think you need to explicitely delete templatename when there is no template because the test in the view to use a template is done on 'template' not 'templatename'. Maybe you could even merge the 2 values, assigning a boolean false value when no template is used and assigning the template name when it is.