add ballot creation and receipt validation in js
a small refactoring (js lib)