add deeper flatten test
remove _flattenneededitems()

this only worked for 1 depth level of dependencies
move obtained functionality out into methods
formatting
fix testcase result
debugging lines
put logic for getting item deps into method _getdeps()
add functional flattening logic in _flatten() method

simply adding all requested items as already obtained allows for reuse
when building