change some function to global for perceptron.js and add BP.js file with basic architecture.