Added tests and typescript stubs