Fix overlap bug in profile module, add overlap tests

Remove debugging instructions
Add sort order parameter for profile iterators