Make isCompiledMethod() a method
Misc cleanup
Split totalBytes into two methods
Implement image writing
Save image to file system