Update AR to 4.1 and update code to use AR's new `enum` feature

- Migrate state machine to use `enum` under the hood
- Add custom error classes
- Update tests
- Misc coding style changes and clean up
- Update README to reflect changes
- Bump to version 0.0.2