change func name to swap
allow to path working directory
include baseDir option and fix path when relative module loading