remove config.mode, allow algo to be a function

Fixes #10, #11 

this line can go away too, it was part of the dir mode logic.