supports python3, moved util functions into __init__

I think it's a reasonable requirement