Fixed release output paths. Fixed build script; can now run build.cmd. Separated internal types and functions into their own module.