Extend scripts and split them up

This split up the extendet scipts into multiple files. Support for
Android was also added. Some mistakes for the Rails build were
corrected.