Initial codereview of languagefilter plugin

This is an initial code review of the languagefilter plugin. There are several sins in this plugin and I tried to simplify and improve the code where possible. 

Testing instructions are simple: 

1. Set up a full fledged multi-lingual installation of Joomla with lots of different content and associations, etc.
2. Check the current behavior.
3. Apply the change
4. See that the behavior did not change :wink: