Get __getindex__ working. Update tests. Make pyflakes happy.