Adding refactored match page

It basically works, but needs more db functions added yet.