refactor: split former-gigantic writeboost_map into pieces

.map function is too complicated before and that mekes it to difficult
to formal code-review.
This patch split the gigantic funtion into meaningful pieces for the
reviewer.

Signed-off-by: Akira Hayakawa <ruby.wktk@gmail.com>
factor out more: prepare_write_pos()

and clean up

Signed-off-by: Akira Hayakawa <ruby.wktk@gmail.com>
Merge branch 'feature/lookup-result' into develop