Utils re-org; More python3 compat.; Added more tests