verious optimizations

- preparations for queue & mail support (buzz, stampie, bernanrd)
- Flashing refactored
- Some bugfixes