Shape module

I take over #1493 in order to fix build errors on Android