Python3 compatible, style update

Signed-off-by: Joseph Lee <joseph@idealist.org>