Split script into separate functions and add a CLI switch to disable OS checking
Add OS checking to binary installer
Move dependency checking into a function