a lot of module work

Signed-off-by: Jens Nyberg <jens.nyberg@gmail.com>