fixed some unicode stuff and some encoding stuff; added more thorough unicode testing; moved deque sorting functions into a new subclass of deque; fixed some broken tests