Updated core library to handle directories better and support ignoring filenames if need be.