Added more functionality to many views

Added a 'flatten' function to twig, this will flatten mult-dim arrays.
Using this function in the view, we only show options in the selector
that aren't already in the table.