Swiss army knife of odds and ends in JavaScript