Abstracted legend creation. Closes #4.