backwards compatibility methods

Reimplemented push() and tokens() for backwards compatibility, plus some
additional unit tests.