Add initial implementation from C port
Add command-line runner