refactor Unique/Config monads
avoid IO monad while compiling
add assertKnownLoc (issue #100)