Refactor Tries src and tests

In major, as stated (commit messages), there were some things not being well used (`String.slice(N, N+1)` is not necessary, e.g - random access is better) and `beforeEach` could be used for instantiating `trie` instances (tests).