Completed prepatcher implementation - still some issues with generics and array types, but usable.

Signed-off-by: Ross Allan <rallanpcl@gmail.com>