3A1: Lots of reused libraries added. Code are modified to allow OS X/iOS dual compiling.