openfimg: Move CF stack logic to code generator

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>