Ported to ARC + Modern obj-c

Thanks to Orta for his improvements.