Daley - Added JavaScript function and tests with initial implementation for parsing map segments (edges)