Classify handwritten digit in javascript using neural networks