add test to make sure o never wins, break frontend js into separate file