Many small changes to improve the stability of the plugin. It also reflects some recent changes in the LW core - which partially were the result of this refactoring.