Re-merge cilent and server files, all tests pass, bumping to 0.4.0