Add 'rex_mode()'

@jimhester does this seem appropriate for #13 ?