Split runtime into executable and library versions. Fixes #118.
Use .dylib for shared libraries on Mac. Fixes #104.