An attempt at making a fully-fledged client in javascript