Merge pull request #160 from dalkon/master

Use C++11 random functions
Code cleanup and optimizations
Fix bug introduced in previous commit
Fix build error in formatDate/formatDateShort