#54 port CHMv8 code + add our tests