execution refactoring

just some refactoring to make the execution of workflows and requests more transparent
<a href='#crh-start'></a><a href='#crh-data-%7B%22processed%22%3A%20%5B%22https%3A//github.com/EnoF/con-rest/pull/33%23issuecomment-66629875%22%2C%20%22https%3A//github.com/EnoF/con-rest/pull/33%23issuecomment-67126284%22%2C%20%22https%3A//github.com/EnoF/con-rest/pull/33%23issuecomment-67133951%22%2C%20%22https%3A//github.com/EnoF/con-rest/pull/33%23issuecomment-67134760%22%2C%20%22https%3A//github.com/EnoF/con-rest/pull/33%23discussion_r21680269%22%2C%20%22https%3A//github.com/EnoF/con-rest/pull/33%23discussion_r21681068%22%2C%20%22https%3A//github.com/EnoF/con-rest/pull/33%23discussion_r21886334%22%5D%2C%20%22comments%22%3A%20%7B%22General%20Comment%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/EnoF/con-rest/pull/33%23issuecomment-66629875%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Looks%20good%20%3A%2B1%3A%20Will%20the%20workflow%20also%20be%20handled%20in%20this%20pull%20request%3F%20%5Cr%5Cn%5Cr%5CnI%27d%20recommend%20to%20do%20that%20in%20a%20separate%20one.%20If%20you%20rebase%20it%2C%20I%27ll%20merge%20it%20%3A%29%22%2C%20%22created_at%22%3A%20%222014-12-11T14%3A56%3A32Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1508400%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/EnoF%22%7D%7D%2C%20%7B%22body%22%3A%20%22Will%20do%20the%20testing%20today%2C%20hope%20we%20can%20merge%20it%20back%20to%20master%20%3A%29%22%2C%20%22created_at%22%3A%20%222014-12-16T08%3A22%3A13Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/8627051%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/TheBay0r%22%7D%7D%2C%20%7B%22body%22%3A%20%22%3A%2B1%3A%3Ca%20href%3D%27%23crh-update-none%27%3E%3C/a%3E%22%2C%20%22created_at%22%3A%20%222014-12-16T09%3A41%3A15Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/8627051%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/TheBay0r%22%7D%7D%2C%20%7B%22body%22%3A%20%22%3Ashipit%3A%22%2C%20%22created_at%22%3A%20%222014-12-16T09%3A48%3A31Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/8627051%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/TheBay0r%22%7D%7D%5D%2C%20%22title%22%3A%20%22General%20Comment%22%7D%2C%20%22Pull%208d24d57514942be1041e0b2704c3f9e6d1f2ff6a%20server/api.js%2012%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/EnoF/con-rest/pull/33%23discussion_r21680269%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Just%20to%20confirm%2C%20since%20I%20don%27t%20know%20_%20that%20well%2C%20the%20provided%20headers%20can%20overwrite%20the%20user%20agent%20right%3F%22%2C%20%22created_at%22%3A%20%222014-12-11T14%3A53%3A17Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1508400%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/EnoF%22%7D%7D%2C%20%7B%22body%22%3A%20%22If%20a%20user-agent%20is%20provided%20in%20the%20headers%2C%20the%20defaultHeaders%20is%20not%20used%20but%20the%20provided%20one%22%2C%20%22created_at%22%3A%20%222014-12-11T15%3A03%3A48Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/8627051%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/TheBay0r%22%7D%7D%2C%20%7B%22body%22%3A%20%22%3A%2B1%3A%3Ca%20href%3D%27%23crh-update-complete%27%3E%3C/a%3E%22%2C%20%22created_at%22%3A%20%222014-12-16T09%3A41%3A15Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/8627051%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/TheBay0r%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20server/api.js%3AL232-296%22%7D%7D%2C%20%22approved%22%3A%20%7B%22https%3A//github.com/TheBay0r%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/8627051%3Fv%3D3%22%7D%7D%7D'></a>
<a href='https://www.codereviewhub.com/'><img src='http://www.codereviewhub.com/site/github-bar.png' height=40></a>

<img src='http://www.codereviewhub.com/site/github-approved-avatar.png'><a href='https://github.com/TheBay0r'><img src='https://avatars.githubusercontent.com/u/8627051?v=3' width=34 height=34></a>

- [x] <a href='#crh-comment-Pull 8d24d57514942be1041e0b2704c3f9e6d1f2ff6a server/api.js 12'></a> <img src='http://www.codereviewhub.com/site/github-completed.png' height=16 width=60>&nbsp;<b><a href='https://github.com/EnoF/con-rest/pull/33#discussion_r21680269'>File: server/api.js:L232-296</a></b>
- <a href='https://github.com/EnoF'><img border=0 src='https://avatars.githubusercontent.com/u/1508400?v=3' height=16 width=16'></a> Just to confirm, since I don't know _ that well, the provided headers can overwrite the user agent right?
- <a href='https://github.com/TheBay0r'><img border=0 src='https://avatars.githubusercontent.com/u/8627051?v=3' height=16 width=16'></a> If a user-agent is provided in the headers, the defaultHeaders is not used but the provided one
- [x] <a href='#crh-comment-General Comment'></a> <img src='http://www.codereviewhub.com/site/github-completed.png' height=16 width=60>&nbsp;<b><a href='https://github.com/EnoF/con-rest/pull/33#issuecomment-66629875'>General Comment</a></b>
- <a href='https://github.com/EnoF'><img border=0 src='https://avatars.githubusercontent.com/u/1508400?v=3' height=16 width=16'></a> Looks good :+1: Will the workflow also be handled in this pull request?
I'd recommend to do that in a separate one. If you rebase it, I'll merge it :)
- <a href='https://github.com/TheBay0r'><img border=0 src='https://avatars.githubusercontent.com/u/8627051?v=3' height=16 width=16'></a> Will do the testing today, hope we can merge it back to master :)


<a href='https://www.codereviewhub.com/EnoF/con-rest/pull/33?mark_as_completed=1'><img src='http://www.codereviewhub.com/site/github-mark-as-completed.png' height=26></a>&nbsp;<a href='https://www.codereviewhub.com/EnoF/con-rest/pull/33?approve=1'><img src='http://www.codereviewhub.com/site/github-approve.png' height=26></a>&nbsp;<a href='https://www.codereviewhub.com/EnoF/con-rest/pull/33?approve=0'><img src='http://www.codereviewhub.com/site/github-undo-approve.png' height=26></a>&nbsp;<a href='https://github.com/EnoF/con-rest/pull/33'><img src='http://www.codereviewhub.com/site/github-refresh.png' height=26></a>
<a href='#crh-end'></a>