Changes for triplet extraction

-Created class to redirect output both to console and to a file.
-New feature to save the triplet object containing all the information
for the categories, saved to a .pkl file. Now the database can be loaded
directly to pass to the extractor without having to run all the queries
each time.
-Fixed other small things