A few fixes

- Use standard header
- Avoid Emacs 24-only features in order to allow use in Emacs 23
- Remove unused code