Add read/write permission support to DBs

Signed-off-by: Michael Buesch <m@bues.ch>
Add DB 0 as read/write-protected system-DB

Signed-off-by: Michael Buesch <m@bues.ch>