update coffee.mk
fix export
a big messy refactoring
add some tests