Moved XML storage to separate module; implemented saving/reading threshold data.