Tweaks to hard 0/1 in source_tree + proper 'limit' handling

Added extra rules for setting the hard flag. See in-code comments

Also changed where limit/exclude options are applied to fix possible
bad/unintended exlusion of sources. I beleive at this point the
structure returned by source_tree is ACCURATE but will still need more
tests/verification as there are many possible edge-cases