Modified tika api and cleaned up code.