rewrite internal Bitmap
fix palette copy
fix compilation (tests fails)
fix tests (WIP)