Add two phase message writing and append command

- add select phase
- add read / write phase
- add append command
- Note ther is abug when writing the message count. Therefor the number of new messages is lost after a reset.