Splitted up bin/diary into several files

This PR refactors the bin/diary file into several files to be able to
call diary.rb as library, too.