Cleaned up prefix trimmer code
Added missing docblock
Fixed prefix trimmer to correctly handle paths
Added trimmer tests