Fix type prefixe -> prefix
Fix python 3 issues for unit systems

- use Expr instead of AtomicExpr
- use key instead of cmp in sorted functions
- fix hashing problems