Refactor stemmer. It also fixes #1