added type declarations and 99% of the prefix tree example
forgot to commit examples