Put parent() in each item

Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Put index() in each item type

Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
pep8-ify

Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>