Major fixes, partial implementation of client script generation
Added example client.js