Support for up/down positioning

Implements #33, taking inspiration from @mixonic's answer to #55.