ApplicationLayer message fixes and unit tests
restructure
Merge branch 'martijn'