Replace mode() with pym.mode

Signed-off-by: Casey Dahlin <casey.dahlin@gmail.com>