move solver into its own dir, add javascript port