Import from Pootle: support all files for one locale

* “locomotion” moved from locale (3rd parameter) to project (4th
parameter)
* Also fix a bug with the output for one locale+all files ($locale_list
not initialized).
Merge pull request #144 from flodolo/issue30

Import from Pootle: support all files for one locale
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, make activated column sortable.
* 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.