Refactor build command (#223)

* Refactoring build, phase 1

* Fmt

* Extract local method for building, always optimize on build

* Add MetadataResult type

* Fmt

* Create dest wasm dir

* Execute build directly from metadata tests

* Modify existing build test to code only, since metadata test now builds all

* Fix errors after merge
3 jobs for master in 5 minutes and 59 seconds (queued for 1 second)
Status Job ID Name Coverage
  Check
passed #860486
linux-docker
fmt

00:00:42

 
  Test
passed #860487
linux-docker
test

00:04:24

 
  Build
passed #860488
linux-docker
build

00:00:52