Added path variable for mbed

I have replaced all relative paths to ./mbed with a variable MBED_DIR to make it easier to move the library to a different location. The default value is still ./mbed.

I also removed 'then' from one of the if-statements. I assume this was a bug.