Initial commit for 2.0

- Complete rewrite
- Improved API