Fix .gitignore ignoring ./lib
Move base classes to lib/