refactors a bunch, adds unicode hack, adds first test