Removed unused code; read skip from post data, added skip to json response
Added test code
Moved javascript to .js file