Patterning and functionalizing self-assembled monolayers