Merge pull request #2 from perconik/master

Code improvements
Order formatted JSON elements in event cache