Initial refactoring to latest react.js version
fixed initial bugs.