Javascript swiss army knife