First stab at longest prefix match.
Added a test for longest prefix match.