A JS implementation of a calculator