Merge pull request #240 from cwc/fixes

Fix crash on receiving PM
Use XHR polling
Fix DB model loading