refine python code
adjust javascript code to new python
Merge branch 'fix_old_pinet' of github.com:zpiman/PiNet into fix_old_pinet