add ability to flatten needed_items

the idea here is that we will use items we are making as resources for
other items we wish to make. this is a first seemingly workable solution
unittest restructuring
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
change flatten to consolidate