Support OSX platform and refactor generator for more effective maintenance

Thank you for your great gem, and I often use this.

I have met a little trouble, when I create the Mac OSX app in RubyMotion with `ib` gem. 
The Stubs.h has unnecessary code; e.g. `#import <UIKit/UIKit.h>`.
The OSX app needs `#import <Cocoa/Cocoa.h>` instead of that.

Then, I have created this pull-request to support Mac OSX platform,
additionally I refactor `lib/ib/generator.rb`.

This change-set depend on `tilt` gem for using template engine to more flexible,
and so, the output will be aligned( you can see aligned output in `spec/generator_spec.rb`).

Please merge this! :smile: