Merged self-signed certificate generation

Did it.

Update:
Fixed issues mentioned by @archSeer.

Closes #50.