Pull a bunch of stuff out of asm.rb and into its own files