Some work to improve C compatibility and a skeleton to add dynamic method mapping. More to come in future commits.