cleaned up and fixed fx.js

I fixed the last things in this now. It should be good enough for daily
usage. And this is the finale version for now. I will update it later on