add smartfs element 'inventory'
move some functions around and remove duplicates from the markets framework