added db duplicate handling, recreated ical system to be more readable. + other minor changes.
Merge remote-tracking branch 'origin/master'