Major refactor; vastly improved API coverage and documentation