Fix gcc compilation warnings

Mostly 'converting to non-pointer type int from NULL' and vice versa
Move ElementStyleCache.* to Core
More fixes for compilation warnings
Merge pull request #111 from viciious/fixwarnings

Fix gcc compilation warnings