Implement phrasebook; a lot of fixes