Move core files into /lib and update spec_helper