Implement Message Counting

- add functions to count messages
- workaround: add xmodem files to main directory (due to an library search index error?)