Refactorize, putting passes stuff in separate module.

Signed-off-by: Martin Raspaud <martin.raspaud@smhi.se>