Harmonized expand, expandAs and repeatTensor

Like the `view` method, the subject methods now accept an optional `result` tensor. The PR includes two new unit tests : `expand` and `repeatTensor`. 

Also fixes #59.
what are these introduced for? They don't seem to be necessary