Compressed Suffix Arrays and Suffix Trees with Applications to Text Indexing and String Matching