Added Legend info to MapServer

- Closes #28
- Added function to generate unique element names.