Change "lib" dir to "core"
Improve tests